<?php
//$this->headLink()->appendStylesheet($this->baseUrl('widget/dataTable/css/dataTables.css'));
if ($this->pageCount): ?>
<div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
<?php echo " Mostrando ".$this->lastItemNumber  ." de ".   $this->totalItemCount. str_repeat("&nbsp;", 5) ; ?>


<!-- Link para a primeira página -->
<?php if (isset($this->previous)): ?>
<?php $params=App_Util_SafeUrl::encriptar(array("page"=>$this->first,"buscar"=>$this->buscar),true); ?>
  <span class="first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default" id="table_id_first">
    <a href="<?php echo $this->baseUrl("/usuarios/index/lista/{$params}");?>">Primero</a>
  </span>
 <?php else: ?>
  <span class="first ui-corner-tl ui-corner-bl fg-button ui-button ui-state-default ui-state-disabled" id="table_id_first">Primero</span>
<?php endif; ?>

<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<?php $params=App_Util_SafeUrl::encriptar(array("page"=>$this->previous,"buscar"=>$this->buscar),true); ?>
  <span class="previous fg-button ui-button ui-state-default" id="table_id_previous">
   <a href="<?php echo $this->baseUrl("/usuarios/index/lista/{$params}");?>">Anterior</a>
  </span>
 <?php else: ?>
  <span class="previous fg-button ui-button ui-state-default ui-state-disabled" id="table_id_previous">Anterior</span>
<?php endif; ?>
  
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
  <?php if ($page != $this->current): ?>
  <?php $params=App_Util_SafeUrl::encriptar(array("page"=>$page,"buscar"=>$this->buscar),true); ?>
  <span class="fg-button ui-button ui-state-default">
    <a href="<?php echo $this->baseUrl("/usuarios/index/lista/{$params}");?>"><?php echo $page; ?></a>
  </span>
  <?php else: ?>
    <?php echo $page; ?>
  <?php endif; ?>
<?php endforeach; ?>
  
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<?php $params=App_Util_SafeUrl::encriptar(array("page"=>$this->next,"buscar"=>$this->buscar),true); ?>
 <span class="next fg-button ui-button ui-state-default" id="table_id_next">
  <a href="<?php echo $this->baseUrl("/usuarios/index/lista/{$params}");?>">Siguiente</a>
 </span>
<?php else: ?>
  <span class="next fg-button ui-button ui-state-default ui-state-disabled" id="table_id_next">Siguiente</span>
<?php endif; ?>

<!-- Ultima page link -->
<?php if (isset($this->next)): ?>
<?php $params=App_Util_SafeUrl::encriptar(array("page"=>$this->last,"buscar"=>$this->buscar),true); ?>
 <span class="last ui-corner-tr ui-corner-br fg-button ui-button ui-state-default" id="table_id_last">
  <a href="<?php echo $this->baseUrl("/usuarios/index/lista/{$params}");?>">Último</a>
 </span>
<?php else: ?>
  <span class="last ui-corner-tr ui-corner-br fg-button ui-button ui-state-default ui-state-disabled" id="table_id_last">Último</span>
<?php endif; ?>

</div>
<?php endif; ?>
